package com.nf.service;

import com.nf.dao.ArticleDao;
import com.nf.entity.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleDao articleDao;

    @Transactional
    public Article getArticleById(Integer id) {
        return articleDao.getArticleById(id);
    }

    @Transactional
    public List<Article> getArticleListByCategoryId(Integer categoryId) {
        return articleDao.getArticleListByCategoryId(categoryId);
    }
}
